<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>

    // 使用async await时需要注意
    // (1)  如果异步操作的父作用域不是函数作用域, 自己包裹一层
    // (2)  如果异步操作的父作用域是函数作用域,直接在父函数前加async关键词

    async function fn() {

    }


    (async function () {


    })();

    (async () => {


    })();

    var fn = async function () {

    }

    var fn = async () => {

    }

    var obj = {
        a: 1,
        b: 2,
        sum: async function () {

        },
        async sum() {

        }
    }


    document.onclick = async function () {

    }




</script>

</html>